package com.ws.process;

import java.util.Scanner;

/*
编写程序:从键盘上输入2021年的"“month"和"“day”，要求通过程序输出输入的日期为2021年的第几天。

 */
public class SwitchCaseExercise {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入月份：");
        int month = scanner.nextInt();
        System.out.print("请输入当前天数：");
        int day = scanner.nextInt();
        int sumDays = 0;
        switch (month) {
            case 12:
                sumDays += 30;
            case 11:
                sumDays += 31;
            case 10:
                sumDays += 30;
            case 9:
                sumDays += 31;
            case 8:
                sumDays += 31;
            case 7:
                sumDays += 30;
            case 6:
                sumDays += 31;
            case 5:
                sumDays += 30;
            case 4:
                sumDays += 31;
            case 3:
                sumDays += 28;
            case 2:
                sumDays += 31;
            case 1:
                sumDays += day;
        }
        System.out.println("当前为 2021 年的第 " + sumDays + " 天");

    }
}
